home *** CD-ROM | disk | FTP | other *** search
Wrap
; The following makes LAMPDQ.E separately compilable, so you can include the ; host functions in EPM even if not using the rest of LaMail. ; Compilation logic: ; If SMALL is defined, then we're being compiled into the base. ; else, if INI_REPLY is defined, then we're being compiled into MAIL ; otherwise, we're being compiled as a stand-alone routine that ; can be linked in at run time. const compile if not defined(SMALL) tryinclude 'mycnf.e' -- Include user's configuration compile if not defined(HOST_SUPPORT) HOST_SUPPORT = 'STD' compile endif compile if HOST_SUPPORT='STD' compile if not defined(HOSTDRIVE) HOSTDRIVE= 'H:' compile endif compile endif compile endif -- not defined(SMALL) compile if not defined(RSCS) RSCS = 'RSCS' compile endif compile if not defined(YKT_stuff) ; This determines whether the Yorktown-specific stuff is included YKT_STUFF=0 compile endif compile if not defined(CORE_stuff) ; This determines whether the CORE-specific stuff is included CORE_STUFF=0 compile endif compile if not defined(YKT_SERVICES) ; This determines whether the Yorktown-specific commands (CORE, PHONE, QLUNCH, ; etc.) are included in the macros and in the menus. YKT_SERVICES=0 compile endif compile if not defined(TILDE_CHAR) compile if EVERSION < '5.21' TILDE_CHAR = '' compile else TILDE_CHAR = '~' compile endif compile endif compile if not defined(AUTO_LAMSERV) ; This determines whether LAMSERV should be started automatically AUTO_LAMSERV = 0 compile endif compile if defined(SMALL) or not defined(INI_REPLY) -- If in base or standalone definit universal host_lt, defaultmenu, activemenu universal host_printers compile if defined(my_LT) host_lt=my_LT -- Used by LaMail.E; needed for E3EMUL if multiple LTs. compile else host_lt='' -- Used by LaMail.E; needed for SLSRPI if multiple LTs. compile endif compile if defined(my_HOST_PRINTERS) host_printers=my_HOST_PRINTERS -- List of default host printers compile else host_printers='' compile endif deletemenu defaultmenu, 6, 0, 0 -- delete the existing Help menu (we want it to stay at the right) call add_VM_cmds_to_menu(defaultmenu) -- add the VM commands to the action bar call add_help_menu(defaultmenu, dos_version()>=1020) -- rebuild the help menu compile if not defined(INI_REPLY) -- If standalone; if in base, MAIN.E will do this. if activemenu=defaultmenu then showmenu activemenu -- show the updated EPM menu endif compile endif defproc add_VM_cmds_to_menu(menu) buildsubmenu menu, 16, TILDE_CHAR'VM cmds', ''\1'Menus for invoking VM-related commands', 0 , 0 buildmenuitem menu, 16, 1600, 'output ~Inserted here...'\9'VMI', 'commandline VMI '\1'Execute a VM command, and have the output inserted into the current file',0,0 buildmenuitem menu, 16, 1601, 'output in ~New file...'\9'VMN', 'commandline VMN '\1'Execute a VM command, and see the output in a new file',0,0 buildmenuitem menu, 16, 1602, 'output in new ~window...'\9'VM', 'commandline VM '\1'Execute a VM command, and see the output in a new edit window',0,0 buildmenuitem menu, 16, 1620, '~Get a copy of host screen'\9'GETHOST', 'gethostd'\1'Insert a copy of the default host screen after the cursor line',0,0 buildmenuitem menu, 16, 1603, \0, '', 4, 0 buildmenuitem menu, 16, 1604, '~List host files...'\9'HLIST', 'hlistprompt'\1'Load a filelist of host files into an edit window',0,0 buildmenuitem menu, 16, 1605, \0, '', 4, 0 buildmenuitem menu, 16, 1606, '~Print current file on host...'\9'HOSTPRT', 'hostprt'\1'Print the current file on a host printer',0,0 buildmenuitem menu, 16, 1607, \0, '', 4, 0 buildmenuitem menu, 16, 1608, '~Query host for messages'\9'QMSG', 'qmsg'\1'Check to see if any new messages arrived since you started LAMSERV',0, 0 compile if YKT_SERVICES buildmenuitem menu, 16, 1609, \0, '', 4, 0 buildmenuitem menu, 16, 1610, 'Look up p~hone number...'\9'PHONE', 'commandline Phone '\1'Invoke the Yorktown PHONE exec',0, 0 buildmenuitem menu, 16, 1611, 'Look up ~services...'\9'SERVICES', 'commandline Services '\1'Invoke the Yorktown SERVICES exec',0, 0 buildmenuitem menu, 16, 1612, \0, '', 4, 0 buildmenuitem menu, 16, 1613, 'See lunch ~menu'\9'QLUNCH', 'VM QLUNCH (NOCLEAR NOHILIGHT'\1'Invoke the Yorktown QLUNCH exec',0, 0 buildmenuitem menu, 16, 1614, 'See ~coffee cart schedule'\9'QCOFFEE', 'VM QCOFFEE NOCLEAR'\1'Invoke the Yorktown QCOFFEE exec',0, 0 ;; CORE command is only defined if we're in MAIL.E ;; buildmenuitem menu, 16, 1615, \0, '', 4, 0 ;; buildmenuitem menu, 16, 1616, 'Append CORE forum'\9'CORE', 'CORE',0, 0 compile endif compile endif ; Procedures for dealing with PDQ from within EPM. ; ; Adds the following commands: ; VM: Sends a command to the host; displays the result on the DOS screen. ; VMI: Sends a command to the host; inserts the result into the current file. ; VMQ: Sends a command to the host; throws away the result. ; TELL: Shorthand for VM TELL. ; POLL: Used to restart the poll loop if exited by Ctrl-break. ; QMSG: Queries the host for messages. (Normally done by POLL) ; Keys defined: ; c_M is defined to pop-up the message window whenever a message is ; received. If no message has been received since the last time ; the key was pressed, then it will display all previously received ; messages (up to 40 lines). ; 88/02/10 Added retry to hostconnect in case user quit PDQ on host, then ; restarted it. Fixed VMI in cases when RC <> 0. Return RCs as ; numbers if in range -32768 .. 32767; else as string x'12345678'. ; 88/05/16 Modified for EOS2. Uses LAMPDQ for host commands. const /* SRPI dynalink functions basic constants */ SA_GET = 1 /* downloading a file */ SA_EXEC = 3 /* executing a command */ defc host universal host_lt parse value upcase(arg(1)) with arg1 rest if arg1='?' then sayerror 'Current host session is "'host_lt'".' elseif arg(1)='' or (length(arg1)=1 & arg1>='A' & arg1<='Z') then if not isoption(rest,'Q') then sayerror 'Host session was "'host_lt'", now changed to "'arg1'".' endif host_lt = arg1 else sayerror 'Invalid argument. ? to query; blank or A-E to set.' endif defc TELL 'VME TELL' arg(1) defc RQ 'VME RQUERY' arg(1) defc VME cmd_rc=sendhostcmdgetrslts(arg(1),hostrc,result) if cmd_rc then sayerror 'Error' cmd_rc 'trying to issue command.' return rc endif if hostrc then parse value upcase(arg(1)) with w1 w2 . if w1='CP' | w1='EXEC' then w1=w1 w2; endif sayerror w1 'error' hostrc': ' result endif defc PHONE parse arg who if who='' then sayerror 'PHONE <name> Looks up that person in the on-line directory. PHONE ? for help.' return endif 'VMN PHONE' who if rc=100 then sayerror 1; endif defc HLIST ---- With features by TJR if arg(1) = '' then hfilespec = '* * A' else hfilespec = upcase(arg(1)) endif sayerror 'Loading 'hfilespec' host files...' 'VMN LISTFILE' hfilespec '(HEADER DATE' if not rc then down; down sayerror 'Move cursor to desired file and press Alt-1 to load it.' endif defc HLISTPROMPT compile if EVERSION >= '5.50' display -8 compile endif sayerror 'Enter file specification. E.g., * SCRIPT * or * XEDIT S. Default is * * A' compile if EVERSION >= '5.50' display 8 compile endif 'commandline HLIST ' compile if EVERSION < '5.50' sayerror 0 compile endif compile if YKT_SERVICES defc SERVICES 'VMN SERVICES' arg(1) if rc=100 then sayerror 1; endif compile endif defc VM -- Send command to VM & display output on DOS screen. universal host_lt if host_lt then hst='"host' host_lt '/Q" '; else hst=''; endif 'open' hst"'Postme VM_OPEN_CMD" arg(1)"'" defc VM_OPEN_CMD -- Passed by VM command as argument of a new session. .autosave = 0 replaceline 'Processing host command' arg(1) .filename = '.Output from' arg(1) settitletext(.filename) ;; call showwindow('ON') ;; repaint_window() size=.last rc=vmi(arg(1),hostrc) if rc then msg = 'Error' rc 'attempting to issue host command.' replaceline msg sayerror msg elseif size=.last then if hostrc then replaceline '[Host cmd failed with RC' hostrc 'and no output.]' else replaceline '[No output]' endif else deleteline 1 .modify = 0 if hostrc<>0 then sayerror 'Host cmd failed with RC' hostrc; endif endif call windowsize1(min(.last+1,24),.windowwidth,0,0,1) -- Size window to size of file defc VMI -- Send command to VM & insert output into current file. size=.last rc=vmi(arg(1),hostrc) if rc then sayerror 'Error' rc 'attempting to issue host command.' return endif if size=.last then if hostrc then sayerror 'Host cmd failed with RC' hostrc 'and no output.' else sayerror '[No output]' endif else insertline '.*----- Output from "'arg(1)'" -----',.line+1 insertline '.*----- [end, RC='hostrc'] -----',.line + .last - size + 1 if hostrc<>0 then sayerror 'Host cmd failed with RC' hostrc; endif endif rc=hostrc defproc VMI(cmd,var host_rc) -- Send command to VM & insert output into current file. universal vTEMP_PATH compile if HOST_SUPPORT = 'SRPI' universal hostrc compile endif compile if HOST_SUPPORT = 'SRPI' call issuehostcommand('',cmd) compile else call issuehostcommand(vTEMP_PATH'HOSTCMD.TMP',cmd) compile endif if rc then return rc; endif compile if HOST_SUPPORT = 'SRPI' host_rc = hostrc compile else 'get' vTEMP_PATH'HOSTCMD.TMP' getline host_rc,.line+1 deleteline .line+1 compile endif defc VMN -- Send command to VM & insert output into a new file. parse value upcase(arg(1)) with w1 w2 . if w1='EXEC' | w1='CP' then w1=w2; endif if w1='Q' then w1='QUERY'; endif -- Assumes user didn't change default. getfileid cmdfileid,w1 'OUTPUT' if cmdfileid='' then 'E /n /q /c .tmp' deleteline 1 .filename=w1 'OUTPUT' oldmodify=0 else activatefile cmdfileid .last oldmodify=.modify endif oldsize=.last 'VMI' arg(1) hostrc=rc .modify=oldmodify if .last=0 then 'Q' else .cursory=1 -- Position so first new line is at top of screen. oldsize+1 endif rc=hostrc defc VMQ -- VM Quiet; send command and throw away output. universal vTEMP_PATH compile if HOST_SUPPORT = 'SRPI' call issuehostcommand(vTEMP_PATH'HOSTCMD.TMP',arg(1),'nul') compile else call issuehostcommand(vTEMP_PATH'HOSTCMD.TMP',arg(1)) call erasetemp(vTEMP_PATH'HOSTCMD.TMP') compile endif defc gethostd -- Get a copy of the default host screen; uses the current default. universal host_lt 'gethost' host_lt defc hostprt -- Print current edit file on host. universal host_printers, host_lt compile if HOST_SUPPORT='EMUL' or HOST_SUPPORT='SRPI' universal hostdrive compile endif printer = 3 if host_printers then printer=listbox('Select a host printer',' 'strip(host_printers),'/Print/Cancel/Select other/') if printer='' then return; endif endif if printer=3 then printer = entrybox('Enter name of host printer','/Print') endif if printer then 'save 'leftstr(hostdrive,1) || host_lt':lamail tmpprt a' if rc then sayerror 'Error' rc 'trying to save to host; print canceled.' return endif stat=sendhostcommand('lamail files print PC2TEMP 'printer' lamail tmpprt a',hostrc) sayerror 0 if stat then return hostcmderror(stat); endif if hostrc then sayerror 'Host returned error code' hostrc endif endif defproc sendhostcommand(cmd,var hostrc) ; Throw away results return sendhostcmdgetrslts(cmd,hostrc,result) ;; ret = sendhostcmdgetrslts(cmd,hostrc,result) -- Alternative to above, ;; sayerror 'sendhostcmdgetrslts('cmd') returned "'ret'"' -- for debugging ;; return ret ; For SRPI and ECF, this routine gets the output into an E file, and the RC ; into the variable HOSTRC. ; For Send/Receive and CP78, the output comes via a disk file, and the RC is ; given on the first line. ; The differences are masked by COMPILE IFs in the callers. (This routine ; is internal to this file.) defproc issuehostcommand(pcfile, host_cmd) compile if HOST_SUPPORT = 'EMUL' -- If using E3EMUL assume SEND/RECEIVE. universal host_lt, hostdrive universal hostcopy, hostcmd compile if USING = 'IBM' ;; quietshell 'RECEIVE' pcfile host_LT':HOSTCMD ('host_cmd'>nul' rc = EHLLAPI_RECEIVE(pcfile host_LT':HOSTCMD ('host_cmd) compile elseif USING = 'CM' compile if EVERSION >= 5 call send_HLLAPI_string('@CLAMPDQ HOSTCMD' host_cmd'@E') compile else if host_lt then lt='/'host_lt' ' else lt='' endif quietshell hostcmd lt'@CLAMPDQ HOSTCMD' host_cmd compile endif call dynalink('DOSCALLS', '#32', atol_swap(2000)) /* 2 second DOSSLEEP */ quietshell hostcopy hostdrive||host_LT':HOSTCMD CMSUT1 * 'pcfile' /q /ascii' compile endif compile elseif HOST_SUPPORT = 'STD' -- If using SAVELOAD assume CP78. quietshell 'CP78CMD LAMPDQ HOSTCMD' host_cmd'>nul' quietshell 'CP78COPY H:HOSTCMD CMSUT1 *' pcfile '/q' compile elseif HOST_SUPPORT = 'SRPI' -- If using SRPI then load directly. universal exec_server, file_server, hostrc, host_lt if arg(3) then queue_name=arg(3)\0 else queue_name = '\QUEUES\EXEQUEUE.000'\0 endif f_s = leftstr(file_server || host_lt, 8)\0 e_s = leftstr(exec_server || host_lt, 8)\0 compile if AUTO_LAMSERV do i=1 to 2 compile endif command = host_cmd\0 -- Set inside loop, because after first call it's EBCDIC /* call SRPI support for command */ request = offset(e_s)||selector(e_s)|| atoi(SA_EXEC)|| '0000000000'|| /* return codes */ offset(command)||selector(command)|| offset(queue_name)||selector(queue_name)|| offset(f_s)||selector(f_s)|| '0000' -- Bytes 29-32 --> command return code rc=0 result= dynalink('SRPILCC', 'SERVEXEC', selector(request)||offset(request)) dynalink_RC = rc if rc=sayerror('Dynalink: Unrecognized library name') then if arg(3)='' then call cleanup(queue_name); endif if arg(4) then call poll('OFF') sayerror 'SRPILCC.DLL not found; polling turned off.' return '^' -- Abort chk_msgs. else messageNwait('SRPILCC.DLL not found; host support can not be used. Press a key.') return dynalink_RC endif endif if result <> 0 then compile if AUTO_LAMSERV if not arg(4) then -- Don't bother if checking messages. if sent_LAMSERV(result, request, i, host_LT) then if arg(3)='' then call cleanup(queue_name); endif iterate; endif endif compile endif if arg(3)='' then call cleanup(queue_name); endif if arg(4) & (result=2) & (ltoa(substr(request, 7, 4), 16)=1000402) then return '^' -- No CMSSERV screen active. endif call show_error(result, request) if arg(4) then return '^'; endif -- Some other error. Abort chk_msgs. rc = result return result endif compile if AUTO_LAMSERV leave enddo compile endif /* temp = substr(request,29,4) sayerror 'temp=' temp sayerror 'after cleanup' display 1 messageNwait('RC = "'temp'" =' asc(leftstr(temp,1)) asc(substr(temp,2,1)) asc(substr(temp,3,1)) asc(substr(temp,4,1)) ) */ hostrc = ltoa(substr(request,29,4),10) if arg(3)='' then -- read output from the command and insert it in the file if pcfile<>'' then 'xcom e /c' pcfile; deleteline 1; endif call grabqueue(queue_name) endif rc = 0 compile else messageNwait('No host command support for' HOST_SUPPORT'. Press a key...') stop compile endif defproc gethostfile(pcfile, hostfile, bin) universal host_lt compile if HOST_SUPPORT = 'EMUL' -- If using E3EMUL assume SEND/RECEIVE. universal hostcopy, hostdrive compile if USING = 'IBM' if bin='B' then opts=''; else opts='(ASCII CRLF'; endif ;; quietshell 'RECEIVE' pcfile host_LT':'hostfile opts'>nul' rc = EHLLAPI_RECEIVE(pcfile host_LT':'hostfile opts) compile elseif USING = 'CM' if bin='B' then opts='/b'; else opts='/ASCII'; endif quietshell hostcopy hostdrive || host_LT':'hostfile pcfile' /q 'opts compile endif compile elseif HOST_SUPPORT = 'STD' -- If using SAVELOAD assume CP78. if bin='B' then opts='/B'; else opts=''; endif quietshell 'CP78COPY H:'hostfile pcfile opts '/q' compile elseif HOST_SUPPORT = 'SRPI' -- If using SRPI then load directly. universal file_server, host_lt pc_name = pcfile\0 host_file = hostfile\0 ;; if bin='B' then flag=0; else flag=1; endif --> flag = bin<>'B' f_s = leftstr(file_server || host_lt, 8)\0 /* building a request */ request = offset(f_s)||selector(f_s)|| atoi(SA_GET)|| '0000000000'|| /* return codes */ offset(host_file)||selector(host_file)|| offset(pc_name)||selector(pc_name)|| atoi(bin<>'B') /* calling the dynalink function */ rc = dynalink('SRPILCC', 'SERVGET', selector(request)||offset(request)) if rc <> 0 then sayerror 'File transfer failed with RC' rc; endif return rc compile else messageNwait("Can't use host support" HOST_SUPPORT'. Press a key...') stop compile endif defproc sendhostcmdgetrslts(cmd,var host_rc,var result) universal vTEMP_PATH compile if HOST_SUPPORT = 'SRPI' universal hostrc compile endif call issuehostcommand(vTEMP_PATH'HOSTCMD.TMP',arg(1)) if rc then /* sayerror 'Uh-oh: RC =' rc; */ return rc; endif compile if HOST_SUPPORT = 'SRPI' result='' if arg(4) then -- Flag to concatenate all lines do i=1 to .last result=result || textline(i) || \13 if length(result)=255 then leave; endif enddo elseif .last then getline result,1 endif host_rc = hostrc -- Set local parm to universal var. value .modify = 0 compile else 'xcom e /d /q' vTEMP_PATH'HOSTCMD.TMP' getline host_rc,1 if .last=1 then result='' else getline result,2 endif call erasetemp(vTEMP_PATH'HOSTCMD.TMP') compile endif 'xcom q' return 0 ;***************** Stuff to support message polling follows: ********** ; Also, add "Call Poll()" to MYMAIN.E defc qmsg -- Query messages - if you don't want to wait for a time-out. universal host_msg_file,msg_file_size if host_msg_file <> '' then -- Make sure it's still valid getfileid fileid display -2 rc = 0 activatefile host_msg_file if rc then host_msg_file = '' msg_file_size = 0 else activatefile fileid endif display 2 endif if host_msg_file = '' then 'xcom e /n /q host_messages' .titletext = 'Host messages' getfileid host_msg_file .autosave=0 deleteline 1 endif status_=chkmsgs() if host_msg_file.last=0 then .modify = 0 'xcom q' host_msg_file = '' endif if status_ then activatefile host_msg_file .cursory = 1 msg_file_size+1 -- Set .line to first new line. msg_file_size = host_msg_file.last if status_=1 then call pplay(1) elseif status_=2 then call pplay(2) elseif status_=3 then call pplay(3) endif else sayerror 'No new messages.' endif defproc chkmsgs universal msgflag, host_lt universal host_msg_file universal vTEMP_PATH universal hostcopy, hostcmd compile if HOST_SUPPORT = 'SRPI' -- If using SRPI then load directly. universal hostrc, hostdrive if '^' = issuehostcommand('','LAMSERV CHKMSGS','NUL',1) then return 0 -- CMSSERV screen not active endif if hostrc <> 1 then return 0; endif -- No messages getfileid startfile call loadfile(hostdrive || host_lt':LAMAIL MSGLOG A','/D /Q') call issuehostcommand('','ERASE LAMAIL MSGLOG A','NUL',1) compile else compile if HOST_SUPPORT = 'EMUL' universal hostdrive compile endif string='12345678' -- reserve 8 bytes. call dynalink('VIOCALLS', /* dynamic link library name */ 'VIOGETCURTYPE', /* Video Input Output GET CURsor TYPE */ selector(string)|| /* string selector */ offset(string)|| /* string offset */ atoi(0)) /* Vio Handle */ compile if HOST_SUPPORT = 'EMUL' compile if USING = 'IBM' ;; quietshell 'RECEIVE' vTEMP_PATH'MSGS.TMP 'host_LT':MSGS >nul' -- This turns cursor back on. rc = EHLLAPI_RECEIVE(vTEMP_PATH'MSGS.TMP 'host_LT':MSGS') -- This turns cursor back on. compile elseif USING = 'CM' compile if EVERSION >= 5 call send_HLLAPI_string('@CLAMPDQ MSGS@E') compile else if host_lt then lt='/'host_lt' ' else lt='' endif quietshell hostcmd lt'@CLAMPDQ MSGS' compile endif call dynalink('DOSCALLS', '#32', atol_swap(2000)) /* 2 second DOSSLEEP */ quietshell hostcopy hostdrive || host_LT':MSGS CMSUT1 * 'vTEMP_PATH'MSGS.TMP /q /ascii' compile endif compile else quietshell 'CP78CMD LAMPDQ MSGS>nul' quietshell 'CP78COPY H:MSGS CMSUT1 *' vTEMP_PATH'MSGS.TMP /q' compile endif status_=rc if substr(string,7,2)==atoi(-1) then call cursoroff() -- turn off cursor endif if status_ then sayerror '(CHKMSGS) Status =' status_; return 0; endif 'xcom e /d /q' vTEMP_PATH'MSGS.TMP' compile endif msgflag=0 /* No messages seen yet. */ if textline(1)<>'' or .last>1 then -- Some messages do i=1 to .last call parsehostmessage(textline(i)) end endif .modify = 0 'xcom q' compile if HOST_SUPPORT = 'SRPI' activatefile startfile -- Restore non-hidden ring. ; display 1 compile else -- If not using SRPI, erase temp file. call erasetemp(vTEMP_PATH'MSGS.TMP') compile endif return msgflag defproc ParseHostMessage(msgline) /* Tailor for yourself. */ universal new_mail,msgflag ; Values for MSGFLAG are: ; 0 - line not added ; 1 - line added, low priority (e.g. RSCS progress message) ; 2 - line added, normal priority (e.g., message from a real user) ; 3 - line added, high priority (e.g., message from director!) universal host_msg_file lclmsgflag=2 /* Default: Add line; normal priority. */ node=''; uid='' parse value msgline with f id ':' rest if upcase(f)='FROM' then /* It's a message! */ uid=id if id=RSCS then parse value rest with w1 rest2 if leftstr(w1,5)='YKTVM' then rest=rest2 endif -- Local YKT-ism parse value rest with f id ':' rest2 if upcase(f)='FROM' then /* Remote message */ if pos('(',id)>0 then /* from a user */ parse value id with node '(' uid ')' msgline=rest else /* from another RSCS mschine */ node=id msgline='From' node'('RSCS'):' rest2 endif else parse value upcase(rest) with w1 w2 w3 w4 w5 w6 w7 w8 w9 . ; w1 w2 w3 w4 w5 w6 w7 w8 w9 ; File (5570) spooled to MYID -- ORG RNODE (RUSER) 2/03/88 17:00:32 EST if w1='FILE' & w3='SPOOLED' & w4='TO' & w7='ORG' & leftstr(w9,1)='(' then node=w8 parse value w9 with '(' uid ')' endif endif endif call setprior(uid,node,lclmsgflag,'MSG',rest) else lclmsgflag=1 -- CP response - give low priority, but display it. parse value upcase(msgline) with w1 w2 w3 w4 w5 w6 w7 . ; PUN FILE 3262 FROM IBMPC COPY 001 NOHOLD ; RDR FILE 3334 TRANSFERRED FROM USER RSCS ; Or, in XA, ; RDR FILE 1234 SENT FROM IBMPC PUN WAS 4321 RECS 0006 CPY 001 B NOHOLD NOKEEP if w2='FILE' then if w4='FROM' then uid=w5 elseif w4='TRANSFERRED' then uid=w7 elseif w4 w5='SENT FROM' then uid=w6 endif endif if uid<>'' then new_mail = 1; endif call setprior(uid,node,lclmsgflag,'CP',msgline) endif if lclmsgflag then /* Insert the line into the message file. */ insertline msgline,host_msg_file.last+1,host_msg_file ; else -- For debugging... ; insertline '(?)' msgline,host_msg_file.last+1,host_msg_file endif msgflag=max(msgflag,lclmsgflag) ;*********** Priorities are set below: ********************** defproc setprior(uid,node,var msgflag,how,text) if uid=RSCS then -- From some RSCS machine. Ignore RSCS messages, but if how='MSG' then -- not FILE TRANSFERRED FROM RSCS msg. if pos('CPQ:',text) then -- Something we asked RSCS? msgflag=2 -- If so, display it else msgflag=0 -- otherwise, discard it. endif endif /* My personal setup; not for product. elseif ((uid='WALDBAU' | uid='SERENSO' | uid='CONNORS' | uid='CONNELL' | uid='ARMSTRN') & (node='' | leftstr(node,5)='YKTVM')) | ((uid='RICH' | uid='RON') & (node='THORNVM')) then msgflag=3 */ endif definit universal host_msg_file,msg_file_size getfileid fileid msg_file_size = 0 host_msg_file = '' ;******************* Following stuff adds the Speaker and Play support ***** defproc pplay(prior) if prior=1 then strng='3000 100 2400 100' elseif prior=2 then strng='2000 100 2200 100 2400 150' elseif prior=3 then strng='800 150 800 150 1000 150 1000 150 1600 180 800 150 900 150' else strng='' endif do forever parse value strng with pitch duration strng if duration='' then leave; endif call beep(pitch,duration) end ;display 1; messageNwait('hostrc=' hostrc'; result="'result'"') compile if EVERSION >= 5 & HOST_SUPPORT = 'EMUL' defproc send_HLLAPI_string(host_string) -- Send a string to the host screen universal host_lt lt = host_lt if lt='' then lt='A'; endif result=simple_HLLAPI_call(1, lt) -- *** Connect to host PS *** if result & result<>4 & result<>5 then -- 4=Busy; 5=Locked sayerror 'Error' result 'trying to connect to host session' lt stop endif result=simple_HLLAPI_call(6, 'LaMail Interface Screen') -- *** Search PS *** if result=24 then if 'Y' = askyesno('LAMPDQ appears to not be running. Would you like it started?',1) then result=simple_HLLAPI_call(3, '@CLAMPDQ@E') -- *** Send key sequence to host *** if result then sayerror 'Error' result 'trying to send LAMPDQ command.' stop endif endif endif result=simple_HLLAPI_call(3, host_string) -- *** Send key sequence to host *** if result then sayerror 'Error' result 'trying to send host command.' stop endif call simple_HLLAPI_call(2, '') -- *** Disconnect from host presentation space *** compile endif